#ifndef LIVECLIENT_H
#define LIVECLIENT_H

#include <QObject>
#include <boost/asio.hpp>
#include <cv.h>

const std::string PORT("10000");
class GraphicsIplImgObject;
class LiveClient : public QObject
{
    Q_OBJECT
public:
    explicit LiveClient(QObject *parent = 0);

    void connectNode(char *nodeName, int idxCam);
    void disconnectNode();

    bool connectionState();
    std::string currentNode();

    void setImgObject(GraphicsIplImgObject *img);
    void setBuffer(IplImage *ipl);

signals:
    void receivedImg();

private:
    bool isRunning;
    std::string m_CurrNode;
    int m_CurrCam;

    GraphicsIplImgObject *m_ImgObj;
    IplImage *m_Buffer;


    /*Network connect function*/
    void m_Connect(char *nodeName, const char *nodePort, int idxCam);
};

#endif // LIVECLIENT_H
